import pygame, os
from pygame.locals import *

import ship

class AlienShip(ship.Ship):
    def __init__(self, x, y, filename, hero):
        self.SPEEDCHANGE = 10
        self.filename = os.path.join("img", filename)
        self.surface = pygame.image.load(self.filename) # SOooo, if the fiel dasent exists it's no biggie. just be INVISIBLE SHIP MAN!!!!!!!!!!

        # ah, alltsa, hero... vi ska nog inte ha den i den har klassen i FRAMTIDEN, men som det ser ut nu sa ar den har. annars kan vi ta bort hela den har init... woo! Ship kanns lite onodig, men men. vi far prata om det imorgon sebbz <3
        self.hero = hero
        self.x = x
        self.y = y
        self.xspeed = 0
        self.yspeed = 0
    
    def update(self):
        self.xspeed = (self.hero.x-self.x)/18.0
        self.yspeed = (self.hero.y-self.y)/18.0
        self.x += self.xspeed
        self.y += self.yspeed

        return True
